home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / JDBC / JDBC_011 / JAVA / SQL / DATABASE.JAV < prev    next >
Encoding:
Text File  |  1996-11-10  |  63.0 KB  |  1,897 lines

  1. /*
  2.  * Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved.
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software
  5.  * and its documentation for NON-COMMERCIAL purposes and without
  6.  * fee is hereby granted provided that this copyright notice
  7.  * appears in all copies. Please refer to the file "LICENSE"
  8.  * for further important copyright and licensing information.
  9.  *
  10.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  11.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  12.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  13.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  14.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  15.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  16.  * 
  17.  * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
  18.  * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
  19.  * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
  20.  * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
  21.  * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
  22.  * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
  23.  * PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES").  SUN
  24.  * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR
  25.  * HIGH RISK ACTIVITIES.
  26.  */
  27.  
  28.  
  29. package java.sql;
  30.  
  31. /**
  32.  * This class provides information about the database as a whole.
  33.  *
  34.  * <P>Many of the methods here return lists of information in ResultSets.
  35.  * You can use the normal ResultSet methods such as getString and getInt 
  36.  * to retrieve the data from these ResultSets.  If a given form of
  37.  * metadata is not available, these methods should throw a SQLException.
  38.  *
  39.  * <P>Some of these methods take arguments that are String patterns.  These
  40.  * arguments all have names such as fooPattern.  Within a pattern String, "%"
  41.  * means match any substring of 0 or more characters, and "_" means match
  42.  * any one character. Only metadata entries matching the search pattern 
  43.  * are returned. If a search pattern argument is set to a null ref, it means 
  44.  * that argument's criteria should be dropped from the search.
  45.  * 
  46.  * <P>A SQLException will be thrown if a driver does not support a meta
  47.  * data method.  In the case of methods that return a ResultSet,
  48.  * either a ResultSet (which may be empty) is returned or a
  49.  * SQLException is thrown.
  50.  */
  51. public interface DatabaseMetaData {
  52.  
  53.     //----------------------------------------------------------------------
  54.     // First, a variety of minor information about the target database.
  55.  
  56.     /**
  57.      * Can all the procedures returned by getProcedures be called by the
  58.      * current user?
  59.      *
  60.      * @return true if so
  61.      */
  62.     boolean allProceduresAreCallable() throws SQLException;
  63.  
  64.     /**
  65.      * Can all the tables returned by getTable be SELECTed by the
  66.      * current user?
  67.      *
  68.      * @return true if so 
  69.      */
  70.     boolean allTablesAreSelectable() throws SQLException;
  71.  
  72.     /**
  73.      * What's the url for this database?
  74.      *
  75.      * @return the url or null if it can't be generated
  76.      */
  77.     String getURL() throws SQLException;
  78.  
  79.     /**
  80.      * What's our user name as known to the database?
  81.      *
  82.      * @return our database user name
  83.      */
  84.     String getUserName() throws SQLException;
  85.  
  86.     /**
  87.      * Is the database in read-only mode?
  88.      *
  89.      * @return true if so
  90.      */
  91.     boolean isReadOnly() throws SQLException;
  92.  
  93.     /**
  94.      * Are NULL values sorted high?
  95.      *
  96.      * @return true if so
  97.      */
  98.     boolean nullsAreSortedHigh() throws SQLException;
  99.  
  100.     /**
  101.      * Are NULL values sorted low?
  102.      *
  103.      * @return true if so
  104.      */
  105.     boolean nullsAreSortedLow() throws SQLException;
  106.  
  107.     /**
  108.      * Are NULL values sorted at the start regardless of sort order?
  109.      *
  110.      * @return true if so 
  111.      */
  112.     boolean nullsAreSortedAtStart() throws SQLException;
  113.  
  114.     /**
  115.      * Are NULL values sorted at the end regardless of sort order?
  116.      *
  117.      * @return true if so
  118.      */
  119.     boolean nullsAreSortedAtEnd() throws SQLException;
  120.  
  121.     /**
  122.      * What's the name of this database product?
  123.      *
  124.      * @return database product name
  125.      */
  126.     String getDatabaseProductName() throws SQLException;
  127.  
  128.     /**
  129.      * What's the version of this database product?
  130.      *
  131.      * @return database version
  132.      */
  133.     String getDatabaseProductVersion() throws SQLException;
  134.  
  135.     /**
  136.      * What's the name of this JDBC driver?
  137.      *
  138.      * @return JDBC driver name
  139.      */
  140.     String getDriverName() throws SQLException;
  141.  
  142.     /**
  143.      * What's the version of this JDBC driver?
  144.      *
  145.      * @return JDBC driver version
  146.      */
  147.     String getDriverVersion() throws SQLException;
  148.  
  149.     /**
  150.      * What's this JDBC driver's major version number?
  151.      *
  152.      * @return JDBC driver major version
  153.      */
  154.     int getDriverMajorVersion();
  155.  
  156.     /**
  157.      * What's this JDBC driver's minor version number?
  158.      *
  159.      * @return JDBC driver minor version number
  160.      */
  161.     int getDriverMinorVersion();
  162.  
  163.     /**
  164.      * Does the database store tables in a local file?
  165.      *
  166.      * @return true if so
  167.      */
  168.     boolean usesLocalFiles() throws SQLException;
  169.  
  170.     /**
  171.      * Does the database use a file for each table?
  172.      *
  173.      * @return true if the database uses a local file for each table
  174.      */
  175.     boolean usesLocalFilePerTable() throws SQLException;
  176.  
  177.     /**
  178.      * Does the database treat mixed case unquoted SQL identifiers as
  179.      * case sensitive and as a result store them in mixed case?
  180.      *
  181.      * A JDBC-Compliant driver will always return false.
  182.      *
  183.      * @return true if so 
  184.      */
  185.     boolean supportsMixedCaseIdentifiers() throws SQLException;
  186.  
  187.     /**
  188.      * Does the database treat mixed case unquoted SQL identifiers as
  189.      * case insensitive and store them in upper case?
  190.      *
  191.      * @return true if so 
  192.      */
  193.     boolean storesUpperCaseIdentifiers() throws SQLException;
  194.  
  195.     /**
  196.      * Does the database treat mixed case unquoted SQL identifiers as
  197.      * case insensitive and store them in lower case?
  198.      *
  199.      * @return true if so 
  200.      */
  201.     boolean storesLowerCaseIdentifiers() throws SQLException;
  202.  
  203.     /**
  204.      * Does the database treat mixed case unquoted SQL identifiers as
  205.      * case insensitive and store them in mixed case?
  206.      *
  207.      * @return true if so 
  208.      */
  209.     boolean storesMixedCaseIdentifiers() throws SQLException;
  210.  
  211.     /**
  212.      * Does the database treat mixed case quoted SQL identifiers as
  213.      * case sensitive and as a result store them in mixed case?
  214.      *
  215.      * A JDBC-Compliant driver will always return false.
  216.      *
  217.      * @return true if so
  218.      */
  219.     boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
  220.  
  221.     /**
  222.      * Does the database treat mixed case quoted SQL identifiers as
  223.      * case insensitive and store them in upper case?
  224.      *
  225.      * @return true if so 
  226.      */
  227.     boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
  228.  
  229.     /**
  230.      * Does the database treat mixed case quoted SQL identifiers as
  231.      * case insensitive and store them in lower case?
  232.      *
  233.      * @return true if so 
  234.      */
  235.     boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
  236.  
  237.     /**
  238.      * Does the database treat mixed case quoted SQL identifiers as
  239.      * case insensitive and store them in mixed case?
  240.      *
  241.      * @return true if so 
  242.      */
  243.     boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
  244.  
  245.     /**
  246.      * What's the string used to quote SQL identifiers?
  247.      * This returns a space " " if identifier quoting isn't supported.
  248.      *
  249.      * A JDBC-Compliant driver always uses a double quote character.
  250.      *
  251.      * @return the quoting string
  252.      */
  253.     String getIdentifierQuoteString() throws SQLException;
  254.  
  255.     /**
  256.      * Get a comma separated list of all a database's SQL keywords
  257.      * that are NOT also SQL92 keywords.
  258.      *
  259.      * @return the list 
  260.      */
  261.     String getSQLKeywords() throws SQLException;
  262.  
  263.     /**
  264.      * Get a comma separated list of math functions.
  265.      *
  266.      * @return the list
  267.      */
  268.     String getNumericFunctions() throws SQLException;
  269.  
  270.     /**
  271.      * Get a comma separated list of string functions.
  272.      *
  273.      * @return the list
  274.      */
  275.     String getStringFunctions() throws SQLException;
  276.  
  277.     /**
  278.      * Get a comma separated list of system functions.
  279.      *
  280.      * @return the list
  281.      */
  282.     String getSystemFunctions() throws SQLException;
  283.  
  284.     /**
  285.      * Get a comma separated list of time and date functions.
  286.      *
  287.      * @return the list
  288.      */
  289.     String getTimeDateFunctions() throws SQLException;
  290.  
  291.     /**
  292.      * This is the string that can be used to escape '_' or '%' in
  293.      * the string pattern style catalog search parameters.
  294.      *
  295.      * <P>The '_' character represents any single character.
  296.      * <P>The '%' character represents any sequence of zero or 
  297.      * more characters.
  298.      * @return the string used to escape wildcard characters
  299.      */
  300.     String getSearchStringEscape() throws SQLException;
  301.  
  302.     /**
  303.      * Get all the "extra" characters that can be used in unquoted
  304.      * identifier names (those beyond a-z, A-Z, 0-9 and _).
  305.      *
  306.      * @return the string containing the extra characters 
  307.      */
  308.     String getExtraNameCharacters() throws SQLException;
  309.  
  310.     //--------------------------------------------------------------------
  311.     // Functions describing which features are supported.
  312.  
  313.     /**
  314.      * Is "ALTER TABLE" with add column supported?
  315.      *
  316.      * @return true if so
  317.      */
  318.     boolean supportsAlterTableWithAddColumn() throws SQLException;
  319.  
  320.     /**
  321.      * Is "ALTER TABLE" with drop column supported?
  322.      *
  323.      * @return true if so
  324.      */
  325.     boolean supportsAlterTableWithDropColumn() throws SQLException;
  326.  
  327.     /**
  328.      * Is column aliasing supported? 
  329.      *
  330.      * <P>If so, the SQL AS clause can be used to provide names for
  331.      * computed columns or to provide alias names for columns as
  332.      * required.
  333.      *
  334.      * A JDBC-Compliant driver always returns true.
  335.      *
  336.      * @return true if so 
  337.      */
  338.     boolean supportsColumnAliasing() throws SQLException;
  339.  
  340.     /**
  341.      * Are concatenations between NULL and non-NULL values NULL?
  342.      *
  343.      * A JDBC-Compliant driver always returns true.
  344.      *
  345.      * @return true if so
  346.      */
  347.     boolean nullPlusNonNullIsNull() throws SQLException;
  348.  
  349.     /**
  350.      * Is the CONVERT function between SQL types supported?
  351.      *
  352.      * @return true if so
  353.      */
  354.     boolean supportsConvert() throws SQLException;
  355.  
  356.     /**
  357.      * Is CONVERT between the given SQL types supported?
  358.      *
  359.      * @param fromType the type to convert from
  360.      * @param toType the type to convert to     
  361.      * @return true if so
  362.      * @see Types
  363.      */
  364.     boolean supportsConvert(int fromType, int toType) throws SQLException;
  365.  
  366.     /**
  367.      * Are table correlation names supported?
  368.      *
  369.      * A JDBC-Compliant driver always returns true.
  370.      *
  371.      * @return true if so
  372.      */
  373.     boolean supportsTableCorrelationNames() throws SQLException;
  374.  
  375.     /**
  376.      * If table correlation names are supported, are they restricted
  377.      * to be different from the names of the tables?
  378.      *
  379.      * @return true if so 
  380.      */
  381.     boolean supportsDifferentTableCorrelationNames() throws SQLException;
  382.  
  383.     /**
  384.      * Are expressions in "ORDER BY" lists supported?
  385.      *
  386.      * @return true if so
  387.      */
  388.     boolean supportsExpressionsInOrderBy() throws SQLException;
  389.  
  390.     /**
  391.      * Can an "ORDER BY" clause use columns not in the SELECT?
  392.      *
  393.      * @return true if so
  394.      */
  395.     boolean supportsOrderByUnrelated() throws SQLException;
  396.  
  397.     /**
  398.      * Is some form of "GROUP BY" clause supported?
  399.      *
  400.      * @return true if so
  401.      */
  402.     boolean supportsGroupBy() throws SQLException;
  403.  
  404.     /**
  405.      * Can a "GROUP BY" clause use columns not in the SELECT?
  406.      *
  407.      * @return true if so
  408.      */
  409.     boolean supportsGroupByUnrelated() throws SQLException;
  410.  
  411.     /**
  412.      * Can a "GROUP BY" clause add columns not in the SELECT
  413.      * provided it specifies all the columns in the SELECT?
  414.      *
  415.      * @return true if so
  416.      */
  417.     boolean supportsGroupByBeyondSelect() throws SQLException;
  418.  
  419.     /**
  420.      * Is the escape character in "LIKE" clauses supported?
  421.      *
  422.      * A JDBC-Compliant driver always returns true.
  423.      *
  424.      * @return true if so
  425.      */
  426.     boolean supportsLikeEscapeClause() throws SQLException;
  427.  
  428.     /**
  429.      * Are multiple ResultSets from a single execute supported?
  430.      *
  431.      * @return true if so
  432.      */
  433.     boolean supportsMultipleResultSets() throws SQLException;
  434.  
  435.     /**
  436.      * Can we have multiple transactions open at once (on different
  437.      * connections)?
  438.      *
  439.      * @return true if so
  440.      */
  441.     boolean supportsMultipleTransactions() throws SQLException;
  442.  
  443.     /**
  444.      * Can columns be defined as non-nullable?
  445.      *
  446.      * A JDBC-Compliant driver always returns true.
  447.      *
  448.      * @return true if so
  449.      */
  450.     boolean supportsNonNullableColumns() throws SQLException;
  451.  
  452.     /**
  453.      * Is the ODBC Minimum SQL grammar supported?
  454.      *
  455.      * All JDBC-Compliant drivers must return true.
  456.      *
  457.      * @return true if so
  458.      */
  459.     boolean supportsMinimumSQLGrammar() throws SQLException;
  460.  
  461.     /**
  462.      * Is the ODBC Core SQL grammar supported?
  463.      *
  464.      * @return true if so
  465.      */
  466.     boolean supportsCoreSQLGrammar() throws SQLException;
  467.  
  468.     /**
  469.      * Is the ODBC Extended SQL grammar supported?
  470.      *
  471.      * @return true if so
  472.      */
  473.     boolean supportsExtendedSQLGrammar() throws SQLException;
  474.  
  475.     /**
  476.      * Is the ANSI92 entry level SQL grammar supported?
  477.      *
  478.      * All JDBC-Compliant drivers must return true.
  479.      *
  480.      * @return true if so
  481.      */
  482.     boolean supportsANSI92EntryLevelSQL() throws SQLException;
  483.  
  484.     /**
  485.      * Is the ANSI92 intermediate SQL grammar supported?
  486.      *
  487.      * @return true if so
  488.      */
  489.     boolean supportsANSI92IntermediateSQL() throws SQLException;
  490.  
  491.     /**
  492.      * Is the ANSI92 full SQL grammar supported?
  493.      *
  494.      * @return true if so
  495.      */
  496.     boolean supportsANSI92FullSQL() throws SQLException;
  497.  
  498.     /**
  499.      * Is the SQL Integrity Enhancement Facility supported?
  500.      *
  501.      * @return true if so
  502.      */
  503.     boolean supportsIntegrityEnhancementFacility() throws SQLException;
  504.  
  505.     /**
  506.      * Is some form of outer join supported?
  507.      *
  508.      * @return true if so
  509.      */
  510.     boolean supportsOuterJoins() throws SQLException;
  511.  
  512.     /**
  513.      * Are full nested outer joins supported?
  514.      *
  515.      * @return true if so
  516.      */
  517.     boolean supportsFullOuterJoins() throws SQLException;
  518.  
  519.     /**
  520.      * Is there limited support for outer joins?  (This will be true
  521.      * if supportFullOuterJoins is true.)
  522.      *
  523.      * @return true if so
  524.      */
  525.     boolean supportsLimitedOuterJoins() throws SQLException;
  526.  
  527.     /**
  528.      * What's the database vendor's preferred term for "schema"?
  529.      *
  530.      * @return the vendor term
  531.      */
  532.     String getSchemaTerm() throws SQLException;
  533.  
  534.     /**
  535.      * What's the database vendor's preferred term for "procedure"?
  536.      *
  537.      * @return the vendor term
  538.      */
  539.     String getProcedureTerm() throws SQLException;
  540.  
  541.     /**
  542.      * What's the database vendor's preferred term for "catalog"?
  543.      *
  544.      * @return the vendor term
  545.      */
  546.     String getCatalogTerm() throws SQLException;
  547.  
  548.     /**
  549.      * Does a catalog appear at the start of a qualified table name?
  550.      * (Otherwise it appears at the end)
  551.      *
  552.      * @return true if it appears at the start 
  553.      */
  554.     boolean isCatalogAtStart() throws SQLException;
  555.  
  556.     /**
  557.      * What's the separator between catalog and table name?
  558.      *
  559.      * @return the separator string
  560.      */
  561.     String getCatalogSeparator() throws SQLException;
  562.  
  563.     /**
  564.      * Can a schema name be used in a data manipulation statement?
  565.      *
  566.      * @return true if so
  567.      */
  568.     boolean supportsSchemasInDataManipulation() throws SQLException;
  569.  
  570.     /**
  571.      * Can a schema name be used in a procedure call statement?
  572.      *
  573.      * @return true if so
  574.      */
  575.     boolean supportsSchemasInProcedureCalls() throws SQLException;
  576.  
  577.     /**
  578.      * Can a schema name be used in a table definition statement?
  579.      *
  580.      * @return true if so
  581.      */
  582.     boolean supportsSchemasInTableDefinitions() throws SQLException;
  583.  
  584.     /**
  585.      * Can a schema name be used in an index definition statement?
  586.      *
  587.      * @return true if so
  588.      */
  589.     boolean supportsSchemasInIndexDefinitions() throws SQLException;
  590.  
  591.     /**
  592.      * Can a schema name be used in a privilege definition statement?
  593.      *
  594.      * @return true if so
  595.      */
  596.     boolean supportsSchemasInPrivilegeDefinitions() throws SQLException;
  597.  
  598.     /**
  599.      * Can a catalog name be used in a data manipulation statement?
  600.      *
  601.      * @return true if so
  602.      */
  603.     boolean supportsCatalogsInDataManipulation() throws SQLException;
  604.  
  605.     /**
  606.      * Can a catalog name be used in a procedure call statement?
  607.      *
  608.      * @return true if so
  609.      */
  610.     boolean supportsCatalogsInProcedureCalls() throws SQLException;
  611.  
  612.     /**
  613.      * Can a catalog name be used in a table definition statement?
  614.      *
  615.      * @return true if so
  616.      */
  617.     boolean supportsCatalogsInTableDefinitions() throws SQLException;
  618.  
  619.     /**
  620.      * Can a catalog name be used in an index definition statement?
  621.      *
  622.      * @return true if so
  623.      */
  624.     boolean supportsCatalogsInIndexDefinitions() throws SQLException;
  625.  
  626.     /**
  627.      * Can a catalog name be used in a privilege definition statement?
  628.      *
  629.      * @return true if so
  630.      */
  631.     boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException;
  632.  
  633.  
  634.     /**
  635.      * Is positioned DELETE supported?
  636.      *
  637.      * @return true if so
  638.      */
  639.     boolean supportsPositionedDelete() throws SQLException;
  640.  
  641.     /**
  642.      * Is positioned UPDATE supported?
  643.      *
  644.      * @return true if so
  645.      */
  646.     boolean supportsPositionedUpdate() throws SQLException;
  647.  
  648.     /**
  649.      * Is SELECT for UPDATE supported?
  650.      *
  651.      * @return true if so
  652.      */
  653.     boolean supportsSelectForUpdate() throws SQLException;
  654.  
  655.     /**
  656.      * Are stored procedure calls using the stored procedure escape
  657.      * syntax supported?
  658.      *
  659.      * @return true if so 
  660.      */
  661.     boolean supportsStoredProcedures() throws SQLException;
  662.  
  663.     /**
  664.      * Are subqueries in comparison expressions supported?
  665.      *
  666.      * A JDBC-Compliant driver always returns true.
  667.      *
  668.      * @return true if so
  669.      */
  670.     boolean supportsSubqueriesInComparisons() throws SQLException;
  671.  
  672.     /**
  673.      * Are subqueries in 'exists' expressions supported?
  674.      *
  675.      * A JDBC-Compliant driver always returns true.
  676.      *
  677.      * @return true if so
  678.      */
  679.     boolean supportsSubqueriesInExists() throws SQLException;
  680.  
  681.     /**
  682.      * Are subqueries in 'in' statements supported?
  683.      *
  684.      * A JDBC-Compliant driver always returns true.
  685.      *
  686.      * @return true if so
  687.      */
  688.     boolean supportsSubqueriesInIns() throws SQLException;
  689.  
  690.     /**
  691.      * Are subqueries in quantified expressions supported?
  692.      *
  693.      * A JDBC-Compliant driver always returns true.
  694.      *
  695.      * @return true if so
  696.      */
  697.     boolean supportsSubqueriesInQuantifieds() throws SQLException;
  698.  
  699.     /**
  700.      * Are correlated subqueries supported?
  701.      *
  702.      * A JDBC-Compliant driver always returns true.
  703.      *
  704.      * @return true if so
  705.      */
  706.     boolean supportsCorrelatedSubqueries() throws SQLException;
  707.  
  708.     /**
  709.      * Is SQL UNION supported?
  710.      *
  711.      * @return true if so
  712.      */
  713.     boolean supportsUnion() throws SQLException;
  714.  
  715.     /**
  716.      * Is SQL UNION ALL supported?
  717.      *
  718.      * @return true if so
  719.      */
  720.     boolean supportsUnionAll() throws SQLException;
  721.  
  722.     /**
  723.      * Can cursors remain open across commits? 
  724.      * 
  725.      * @return true if cursors always remain open; false if they might not remain open
  726.      */
  727.     boolean supportsOpenCursorsAcrossCommit() throws SQLException;
  728.  
  729.     /**
  730.      * Can cursors remain open across rollbacks?
  731.      * 
  732.      * @return true if cursors always remain open; false if they might not remain open
  733.      */
  734.     boolean supportsOpenCursorsAcrossRollback() throws SQLException;
  735.  
  736.     /**
  737.      * Can statements remain open across commits?
  738.      * 
  739.      * @return true if statements always remain open; false if they might not remain open
  740.      */
  741.     boolean supportsOpenStatementsAcrossCommit() throws SQLException;
  742.  
  743.     /**
  744.      * Can statements remain open across rollbacks?
  745.      * 
  746.      * @return true if statements always remain open; false if they might not remain open
  747.      */
  748.     boolean supportsOpenStatementsAcrossRollback() throws SQLException;
  749.  
  750.     
  751.  
  752.     //----------------------------------------------------------------------
  753.     // The following group of methods exposes various limitations 
  754.     // based on the target database with the current driver.
  755.     // Unless otherwise specified, a result of zero means there is no
  756.     // limit, or the limit is not known.
  757.     
  758.     /**
  759.      * How many hex characters can you have in an inline binary literal?
  760.      *
  761.      * @return max literal length
  762.      */
  763.     int getMaxBinaryLiteralLength() throws SQLException;
  764.  
  765.     /**
  766.      * What's the max length for a character literal?
  767.      *
  768.      * @return max literal length
  769.      */
  770.     int getMaxCharLiteralLength() throws SQLException;
  771.  
  772.     /**
  773.      * What's the limit on column name length?
  774.      *
  775.      * @return max literal length
  776.      */
  777.     int getMaxColumnNameLength() throws SQLException;
  778.  
  779.     /**
  780.      * What's the maximum number of columns in a "GROUP BY" clause?
  781.      *
  782.      * @return max number of columns
  783.      */
  784.     int getMaxColumnsInGroupBy() throws SQLException;
  785.  
  786.     /**
  787.      * What's the maximum number of columns allowed in an index?
  788.      *
  789.      * @return max columns
  790.      */
  791.     int getMaxColumnsInIndex() throws SQLException;
  792.  
  793.     /**
  794.      * What's the maximum number of columns in an "ORDER BY" clause?
  795.      *
  796.      * @return max columns
  797.      */
  798.     int getMaxColumnsInOrderBy() throws SQLException;
  799.  
  800.     /**
  801.      * What's the maximum number of columns in a "SELECT" list?
  802.      *
  803.      * @return max columns
  804.      */
  805.     int getMaxColumnsInSelect() throws SQLException;
  806.  
  807.     /**
  808.      * What's the maximum number of columns in a table?
  809.      *
  810.      * @return max columns
  811.      */
  812.     int getMaxColumnsInTable() throws SQLException;
  813.  
  814.     /**
  815.      * How many active connections can we have at a time to this database?
  816.      *
  817.      * @return max connections
  818.      */
  819.     int getMaxConnections() throws SQLException;
  820.  
  821.     /**
  822.      * What's the maximum cursor name length?
  823.      *
  824.      * @return max cursor name length in bytes
  825.      */
  826.     int getMaxCursorNameLength() throws SQLException;
  827.  
  828.     /**
  829.      * What's the maximum length of an index (in bytes)?    
  830.      *
  831.      * @return max index length in bytes
  832.      */
  833.     int getMaxIndexLength() throws SQLException;
  834.  
  835.     /**
  836.      * What's the maximum length allowed for a schema name?
  837.      *
  838.      * @return max name length in bytes
  839.      */
  840.     int getMaxSchemaNameLength() throws SQLException;
  841.  
  842.     /**
  843.      * What's the maximum length of a procedure name?
  844.      *
  845.      * @return max name length in bytes
  846.      */
  847.     int getMaxProcedureNameLength() throws SQLException;
  848.  
  849.     /**
  850.      * What's the maximum length of a catalog name?
  851.      *
  852.      * @return max name length in bytes
  853.      */
  854.     int getMaxCatalogNameLength() throws SQLException;
  855.  
  856.     /**
  857.      * What's the maximum length of a single row?
  858.      *
  859.      * @return max row size in bytes
  860.      */
  861.     int getMaxRowSize() throws SQLException;
  862.  
  863.     /**
  864.      * Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY
  865.      * blobs?
  866.      *
  867.      * @return true if so 
  868.      */
  869.     boolean doesMaxRowSizeIncludeBlobs() throws SQLException;
  870.  
  871.     /**
  872.      * What's the maximum length of a SQL statement?
  873.      *
  874.      * @return max length in bytes
  875.      */
  876.     int getMaxStatementLength() throws SQLException;
  877.  
  878.     /**
  879.      * How many active statements can we have open at one time to this
  880.      * database?
  881.      *
  882.      * @return the maximum 
  883.      */
  884.     int getMaxStatements() throws SQLException;
  885.  
  886.     /**
  887.      * What's the maximum length of a table name?
  888.      *
  889.      * @return max name length in bytes
  890.      */
  891.     int getMaxTableNameLength() throws SQLException;
  892.  
  893.     /**
  894.      * What's the maximum number of tables in a SELECT?
  895.      *
  896.      * @return the maximum
  897.      */
  898.     int getMaxTablesInSelect() throws SQLException;
  899.  
  900.     /**
  901.      * What's the maximum length of a user name?
  902.      *
  903.      * @return max name length  in bytes
  904.      */
  905.     int getMaxUserNameLength() throws SQLException;
  906.  
  907.     //----------------------------------------------------------------------
  908.  
  909.     /**
  910.      * What's the database's default transaction isolation level?  The
  911.      * values are defined in java.sql.Connection.
  912.      *
  913.      * @return the default isolation level 
  914.      * @see Connection
  915.      */
  916.     int getDefaultTransactionIsolation() throws SQLException;
  917.  
  918.     /**
  919.      * Are transactions supported? If not, commit is a noop and the
  920.      * isolation level is TRANSACTION_NONE.
  921.      *
  922.      * @return true if transactions are supported 
  923.      */
  924.     boolean supportsTransactions() throws SQLException;
  925.  
  926.     /**
  927.      * Does the database support the given transaction isolation level?
  928.      *
  929.      * @param level the values are defined in java.sql.Connection
  930.      * @return true if so 
  931.      * @see Connection
  932.      */
  933.     boolean supportsTransactionIsolationLevel(int level)
  934.                             throws SQLException;
  935.  
  936.     /**
  937.      * Are both data definition and data manipulation statements
  938.      * within a transaction supported?
  939.      *
  940.      * @return true if so 
  941.      */
  942.     boolean supportsDataDefinitionAndDataManipulationTransactions()
  943.                              throws SQLException;
  944.     /**
  945.      * Are only data manipulation statements within a transaction
  946.      * supported?
  947.      *
  948.      * @return true if so
  949.      */
  950.     boolean supportsDataManipulationTransactionsOnly()
  951.                             throws SQLException;
  952.     /**
  953.      * Does a data definition statement within a transaction force the
  954.      * transaction to commit?
  955.      *
  956.      * @return true if so 
  957.      */
  958.     boolean dataDefinitionCausesTransactionCommit()
  959.                             throws SQLException;
  960.     /**
  961.      * Is a data definition statement within a transaction ignored?
  962.      *
  963.      * @return true if so 
  964.      */
  965.     boolean dataDefinitionIgnoredInTransactions()
  966.                             throws SQLException;
  967.  
  968.  
  969.     /**
  970.      * Get a description of stored procedures available in a
  971.      * catalog.
  972.      *
  973.      * <P>Only procedure descriptions matching the schema and
  974.      * procedure name criteria are returned.  They are ordered by
  975.      * PROCEDURE_SCHEM, and PROCEDURE_NAME.
  976.      *
  977.      * <P>Each procedure description has the the following columns:
  978.      *  <OL>
  979.      *    <LI><B>PROCEDURE_CAT</B> String => procedure catalog (may be null)
  980.      *    <LI><B>PROCEDURE_SCHEM</B> String => procedure schema (may be null)
  981.      *    <LI><B>PROCEDURE_NAME</B> String => procedure name
  982.      *  <LI> reserved for future use
  983.      *  <LI> reserved for future use
  984.      *  <LI> reserved for future use
  985.      *    <LI><B>REMARKS</B> String => explanatory comment on the procedure
  986.      *    <LI><B>PROCEDURE_TYPE</B> short => kind of procedure:
  987.      *      <UL>
  988.      *      <LI> procedureResultUnknown - May return a result
  989.      *      <LI> procedureNoResult - Does not return a result
  990.      *      <LI> procedureReturnsResult - Returns a result
  991.      *      </UL>
  992.      *  </OL>
  993.      *
  994.      * @param catalog a catalog name; "" retrieves those without a
  995.      * catalog; null means drop catalog name from the selection criteria
  996.      * @param schemaPattern a schema name pattern; "" retrieves those
  997.      * without a schema
  998.      * @param procedureNamePattern a procedure name pattern 
  999.      * @return ResultSet - each row is a procedure description 
  1000.      * @see #getSearchStringEscape 
  1001.      */
  1002.     ResultSet getProcedures(String catalog, String schemaPattern,
  1003.             String procedureNamePattern) throws SQLException;
  1004.  
  1005.     /**
  1006.      * PROCEDURE_TYPE - May return a result.
  1007.      */
  1008.     int procedureResultUnknown    = 0;
  1009.     /**
  1010.      * PROCEDURE_TYPE - Does not return a result.
  1011.      */
  1012.     int procedureNoResult        = 1;
  1013.     /**
  1014.      * PROCEDURE_TYPE - Returns a result.
  1015.      */
  1016.     int procedureReturnsResult    = 2;
  1017.  
  1018.     /**
  1019.      * Get a description of a catalog's stored procedure parameters
  1020.      * and result columns.
  1021.      *
  1022.      * <P>Only descriptions matching the schema, procedure and
  1023.      * parameter name criteria are returned.  They are ordered by
  1024.      * PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return value,
  1025.      * if any, is first. Next are the parameter descriptions in call
  1026.      * order. The column descriptions follow in column number order.
  1027.      *
  1028.      * <P>Each row in the ResultSet is a parameter description or
  1029.      * column description with the following fields:
  1030.      *  <OL>
  1031.      *    <LI><B>PROCEDURE_CAT</B> String => procedure catalog (may be null)
  1032.      *    <LI><B>PROCEDURE_SCHEM</B> String => procedure schema (may be null)
  1033.      *    <LI><B>PROCEDURE_NAME</B> String => procedure name
  1034.      *    <LI><B>COLUMN_NAME</B> String => column/parameter name 
  1035.      *    <LI><B>COLUMN_TYPE</B> Short => kind of column/parameter:
  1036.      *      <UL>
  1037.      *      <LI> procedureColumnUnknown - nobody knows
  1038.      *      <LI> procedureColumnIn - IN parameter
  1039.      *      <LI> procedureColumnInOut - INOUT parameter
  1040.      *      <LI> procedureColumnOut - OUT parameter
  1041.      *      <LI> procedureColumnReturn - procedure return value
  1042.      *      <LI> procedureColumnResult - result column in ResultSet
  1043.      *      </UL>
  1044.      *  <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types
  1045.      *    <LI><B>TYPE_NAME</B> String => SQL type name
  1046.      *    <LI><B>PRECISION</B> int => precision
  1047.      *    <LI><B>LENGTH</B> int => length in bytes of data
  1048.      *    <LI><B>SCALE</B> short => scale
  1049.      *    <LI><B>RADIX</B> short => radix
  1050.      *    <LI><B>NULLABLE</B> short => can it contain NULL?
  1051.      *      <UL>
  1052.      *      <LI> procedureNoNulls - does not allow NULL values
  1053.      *      <LI> procedureNullable - allows NULL values
  1054.      *      <LI> procedureNullableUnknown - nullability unknown
  1055.      *      </UL>
  1056.      *    <LI><B>REMARKS</B> String => comment describing parameter/column
  1057.      *  </OL>
  1058.      *
  1059.      * <P><B>Note:</B> Some databases may not return the column
  1060.      * descriptions for a procedure. Additional columns beyond
  1061.      * REMARKS can be defined by the database.
  1062.      *
  1063.      * @param catalog a catalog name; "" retrieves those without a
  1064.      * catalog; null means drop catalog name from the selection criteria
  1065.      * @param schemaPattern a schema name pattern; "" retrieves those
  1066.      * without a schema 
  1067.      * @param procedureNamePattern a procedure name pattern 
  1068.      * @param columnNamePattern a column name pattern 
  1069.      * @return ResultSet - each row is a stored procedure parameter or 
  1070.      *      column description 
  1071.      * @see #getSearchStringEscape 
  1072.      */
  1073.     ResultSet getProcedureColumns(String catalog,
  1074.             String schemaPattern,
  1075.             String procedureNamePattern, 
  1076.             String columnNamePattern) throws SQLException;
  1077.  
  1078.     /**
  1079.      * COLUMN_TYPE - nobody knows.
  1080.      */
  1081.     int procedureColumnUnknown = 0;
  1082.  
  1083.     /**
  1084.      * COLUMN_TYPE - IN parameter.
  1085.      */
  1086.     int procedureColumnIn = 1;
  1087.  
  1088.     /**
  1089.      * COLUMN_TYPE - INOUT parameter.
  1090.      */
  1091.     int procedureColumnInOut = 2;
  1092.  
  1093.     /**
  1094.      * COLUMN_TYPE - OUT parameter.
  1095.      */
  1096.     int procedureColumnOut = 4;
  1097.     /**
  1098.      * COLUMN_TYPE - procedure return value.
  1099.      */
  1100.     int procedureColumnReturn = 5;
  1101.  
  1102.     /**
  1103.      * COLUMN_TYPE - result column in ResultSet.
  1104.      */
  1105.     int procedureColumnResult = 3;
  1106.  
  1107.     /**
  1108.      * TYPE NULLABLE - does not allow NULL values.
  1109.      */
  1110.     int procedureNoNulls = 0;
  1111.  
  1112.     /**
  1113.      * TYPE NULLABLE - allows NULL values.
  1114.      */
  1115.     int procedureNullable = 1;
  1116.  
  1117.     /**
  1118.      * TYPE NULLABLE - nullability unknown.
  1119.      */
  1120.     int procedureNullableUnknown = 2;
  1121.  
  1122.  
  1123.     /**
  1124.      * Get a description of tables available in a catalog.
  1125.      *
  1126.      * <P>Only table descriptions matching the catalog, schema, table
  1127.      * name and type criteria are returned.  They are ordered by
  1128.      * TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
  1129.      *
  1130.      * <P>Each table description has the following columns:
  1131.      *  <OL>
  1132.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1133.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1134.      *    <LI><B>TABLE_NAME</B> String => table name
  1135.      *    <LI><B>TABLE_TYPE</B> String => table type.  Typical types are "TABLE",
  1136.      *            "VIEW",    "SYSTEM TABLE", "GLOBAL TEMPORARY", 
  1137.      *            "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
  1138.      *    <LI><B>REMARKS</B> String => explanatory comment on the table
  1139.      *  </OL>
  1140.      *
  1141.      * <P><B>Note:</B> Some databases may not return information for
  1142.      * all tables.
  1143.      *
  1144.      * @param catalog a catalog name; "" retrieves those without a
  1145.      * catalog; null means drop catalog name from the selection criteria
  1146.      * @param schemaPattern a schema name pattern; "" retrieves those
  1147.      * without a schema
  1148.      * @param tableNamePattern a table name pattern 
  1149.      * @param types a list of table types to include; null returns all types 
  1150.      * @return ResultSet - each row is a table description
  1151.      * @see #getSearchStringEscape 
  1152.      */
  1153.     ResultSet getTables(String catalog, String schemaPattern,
  1154.         String tableNamePattern, String types[]) throws SQLException;
  1155.  
  1156.     /**
  1157.      * Get the schema names available in this database.  The results
  1158.      * are ordered by schema name.
  1159.      *
  1160.      * <P>The schema column is:
  1161.      *  <OL>
  1162.      *    <LI><B>TABLE_SCHEM</B> String => schema name
  1163.      *  </OL>
  1164.      *
  1165.      * @return ResultSet - each row has a single String column that is a
  1166.      * schema name 
  1167.      */
  1168.     ResultSet getSchemas() throws SQLException;
  1169.  
  1170.     /**
  1171.      * Get the catalog names available in this database.  The results
  1172.      * are ordered by catalog name.
  1173.      *
  1174.      * <P>The catalog column is:
  1175.      *  <OL>
  1176.      *    <LI><B>TABLE_CAT</B> String => catalog name
  1177.      *  </OL>
  1178.      *
  1179.      * @return ResultSet - each row has a single String column that is a
  1180.      * catalog name 
  1181.      */
  1182.     ResultSet getCatalogs() throws SQLException;
  1183.  
  1184.     /**
  1185.      * Get the table types available in this database.  The results
  1186.      * are ordered by table type.
  1187.      *
  1188.      * <P>The table type is:
  1189.      *  <OL>
  1190.      *    <LI><B>TABLE_TYPE</B> String => table type.  Typical types are "TABLE",
  1191.      *            "VIEW",    "SYSTEM TABLE", "GLOBAL TEMPORARY", 
  1192.      *            "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
  1193.      *  </OL>
  1194.      *
  1195.      * @return ResultSet - each row has a single String column that is a
  1196.      * table type 
  1197.      */
  1198.     ResultSet getTableTypes() throws SQLException;
  1199.  
  1200.     /**
  1201.      * Get a description of table columns available in a catalog.
  1202.      *
  1203.      * <P>Only column descriptions matching the catalog, schema, table
  1204.      * and column name criteria are returned.  They are ordered by
  1205.      * TABLE_SCHEM, TABLE_NAME and ORDINAL_POSITION.
  1206.      *
  1207.      * <P>Each column description has the following columns:
  1208.      *  <OL>
  1209.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1210.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1211.      *    <LI><B>TABLE_NAME</B> String => table name
  1212.      *    <LI><B>COLUMN_NAME</B> String => column name
  1213.      *    <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types
  1214.      *    <LI><B>TYPE_NAME</B> String => Data source dependent type name
  1215.      *    <LI><B>COLUMN_SIZE</B> int => column size.  For char or date
  1216.      *        types this is the maximum number of characters, for numeric or
  1217.      *        decimal types this is precision.
  1218.      *    <LI><B>BUFFER_LENGTH</B> is not used.
  1219.      *    <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
  1220.      *    <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
  1221.      *    <LI><B>NULLABLE</B> int => is NULL allowed?
  1222.      *      <UL>
  1223.      *      <LI> columnNoNulls - might not allow NULL values
  1224.      *      <LI> columnNullable - definitely allows NULL values
  1225.      *      <LI> columnNullableUnknown - nullability unknown
  1226.      *      </UL>
  1227.      *    <LI><B>REMARKS</B> String => comment describing column (may be null)
  1228.      *     <LI><B>COLUMN_DEF</B> String => default value (may be null)
  1229.      *    <LI><B>SQL_DATA_TYPE</B> int => unused
  1230.      *    <LI><B>SQL_DATETIME_SUB</B> int => unused
  1231.      *    <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the 
  1232.      *       maximum number of bytes in the column
  1233.      *    <LI><B>ORDINAL_POSITION</B> int    => index of column in table 
  1234.      *      (starting at 1)
  1235.      *    <LI><B>IS_NULLABLE</B> String => "NO" means column definitely 
  1236.      *      does not allow NULL values; "YES" means the column might 
  1237.      *      allow NULL values.  An empty string means nobody knows.
  1238.      *  </OL>
  1239.      *
  1240.      * @param catalog a catalog name; "" retrieves those without a
  1241.      * catalog; null means drop catalog name from the selection criteria
  1242.      * @param schemaPattern a schema name pattern; "" retrieves those
  1243.      * without a schema
  1244.      * @param tableNamePattern a table name pattern 
  1245.      * @param columnNamePattern a column name pattern 
  1246.      * @return ResultSet - each row is a column description
  1247.      * @see #getSearchStringEscape 
  1248.      */
  1249.     ResultSet getColumns(String catalog, String schemaPattern,
  1250.         String tableNamePattern, String columnNamePattern)
  1251.                     throws SQLException;
  1252.     /**
  1253.      * COLUMN NULLABLE - might not allow NULL values.
  1254.      */
  1255.     int columnNoNulls = 0;
  1256.  
  1257.     /**
  1258.      * COLUMN NULLABLE - definitely allows NULL values.
  1259.      */
  1260.     int columnNullable = 1;
  1261.  
  1262.     /**
  1263.      * COLUMN NULLABLE - nullability unknown.
  1264.      */
  1265.     int columnNullableUnknown = 2;
  1266.  
  1267.     /**
  1268.      * Get a description of the access rights for a table's columns.
  1269.      *
  1270.      * <P>Only privileges matching the column name criteria are
  1271.      * returned.  They are ordered by COLUMN_NAME and PRIVILEGE.
  1272.      *
  1273.      * <P>Each privilige description has the following columns:
  1274.      *  <OL>
  1275.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1276.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1277.      *    <LI><B>TABLE_NAME</B> String => table name
  1278.      *    <LI><B>COLUMN_NAME</B> String => column name
  1279.      *    <LI><B>GRANTOR</B> => grantor of access (may be null)
  1280.      *    <LI><B>GRANTEE</B> String => grantee of access
  1281.      *    <LI><B>PRIVILEGE</B> String => name of access (SELECT, 
  1282.      *      INSERT, UPDATE, REFRENCES, ...)
  1283.      *    <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted 
  1284.      *      to grant to others; "NO" if not; null if unknown 
  1285.      *  </OL>
  1286.      *
  1287.      * @param catalog a catalog name; "" retrieves those without a
  1288.      * catalog; null means drop catalog name from the selection criteria
  1289.      * @param schema a schema name; "" retrieves those without a schema
  1290.      * @param table a table name
  1291.      * @param columnNamePattern a column name pattern 
  1292.      * @return ResultSet - each row is a column privilege description
  1293.      * @see #getSearchStringEscape 
  1294.      */
  1295.     ResultSet getColumnPrivileges(String catalog, String schema,
  1296.         String table, String columnNamePattern) throws SQLException;
  1297.  
  1298.     /**
  1299.      * Get a description of the access rights for each table available
  1300.      * in a catalog. Note that a table privilege applies to one or
  1301.      * more columns in the table. It would be wrong to assume that
  1302.      * this priviledge applies to all columns (this may be true for
  1303.      * some systems but is not true for all.)
  1304.      *
  1305.      * <P>Only privileges matching the schema and table name
  1306.      * criteria are returned.  They are ordered by TABLE_SCHEM,
  1307.      * TABLE_NAME, and PRIVILEGE.
  1308.      *
  1309.      * <P>Each privilige description has the following columns:
  1310.      *  <OL>
  1311.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1312.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1313.      *    <LI><B>TABLE_NAME</B> String => table name
  1314.      *    <LI><B>GRANTOR</B> => grantor of access (may be null)
  1315.      *    <LI><B>GRANTEE</B> String => grantee of access
  1316.      *    <LI><B>PRIVILEGE</B> String => name of access (SELECT, 
  1317.      *      INSERT, UPDATE, REFRENCES, ...)
  1318.      *    <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted 
  1319.      *      to grant to others; "NO" if not; null if unknown 
  1320.      *  </OL>
  1321.      *
  1322.      * @param catalog a catalog name; "" retrieves those without a
  1323.      * catalog; null means drop catalog name from the selection criteria
  1324.      * @param schemaPattern a schema name pattern; "" retrieves those
  1325.      * without a schema
  1326.      * @param tableNamePattern a table name pattern 
  1327.      * @return ResultSet - each row is a table privilege description
  1328.      * @see #getSearchStringEscape 
  1329.      */
  1330.     ResultSet getTablePrivileges(String catalog, String schemaPattern,
  1331.                 String tableNamePattern) throws SQLException;
  1332.  
  1333.     /**
  1334.      * Get a description of a table's optimal set of columns that
  1335.      * uniquely identifies a row. They are ordered by SCOPE.
  1336.      *
  1337.      * <P>Each column description has the following columns:
  1338.      *  <OL>
  1339.      *    <LI><B>SCOPE</B> short => actual scope of result
  1340.      *      <UL>
  1341.      *      <LI> bestRowTemporary - very temporary, while using row
  1342.      *      <LI> bestRowTransaction - valid for remainder of current transaction
  1343.      *      <LI> bestRowSession - valid for remainder of current session
  1344.      *      </UL>
  1345.      *    <LI><B>COLUMN_NAME</B> String => column name
  1346.      *    <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
  1347.      *    <LI><B>TYPE_NAME</B> String => Data source dependent type name
  1348.      *    <LI><B>COLUMN_SIZE</B> int => precision
  1349.      *    <LI><B>BUFFER_LENGTH</B> int => not used
  1350.      *    <LI><B>DECIMAL_DIGITS</B> short     => scale
  1351.      *    <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column 
  1352.      *      like an Oracle ROWID
  1353.      *      <UL>
  1354.      *      <LI> bestRowUnknown - may or may not be pseudo column
  1355.      *      <LI> bestRowNotPseudo - is NOT a pseudo column
  1356.      *      <LI> bestRowPseudo - is a pseudo column
  1357.      *      </UL>
  1358.      *  </OL>
  1359.      *
  1360.      * @param catalog a catalog name; "" retrieves those without a
  1361.      * catalog; null means drop catalog name from the selection criteria
  1362.      * @param schema a schema name; "" retrieves those without a schema
  1363.      * @param table a table name
  1364.      * @param scope the scope of interest; use same values as SCOPE
  1365.      * @param nullable include columns that are nullable?
  1366.      * @return ResultSet - each row is a column description 
  1367.      */
  1368.     ResultSet getBestRowIdentifier(String catalog, String schema,
  1369.         String table, int scope, boolean nullable) throws SQLException;
  1370.     
  1371.     /**
  1372.      * BEST ROW SCOPE - very temporary, while using row.
  1373.      */
  1374.     int bestRowTemporary   = 0;
  1375.  
  1376.     /**
  1377.      * BEST ROW SCOPE - valid for remainder of current transaction.
  1378.      */
  1379.     int bestRowTransaction = 1;
  1380.  
  1381.     /**
  1382.      * BEST ROW SCOPE - valid for remainder of current session.
  1383.      */
  1384.     int bestRowSession     = 2;
  1385.  
  1386.     /**
  1387.      * BEST ROW PSEUDO_COLUMN - may or may not be pseudo column.
  1388.      */
  1389.     int bestRowUnknown    = 0;
  1390.  
  1391.     /**
  1392.      * BEST ROW PSEUDO_COLUMN - is NOT a pseudo column.
  1393.      */
  1394.     int bestRowNotPseudo    = 1;
  1395.  
  1396.     /**
  1397.      * BEST ROW PSEUDO_COLUMN - is a pseudo column.
  1398.      */
  1399.     int bestRowPseudo    = 2;
  1400.  
  1401.     /**
  1402.      * Get a description of a table's columns that are automatically
  1403.      * updated when any value in a row is updated.  They are
  1404.      * unordered.
  1405.      *
  1406.      * <P>Each column description has the following columns:
  1407.      *  <OL>
  1408.      *    <LI><B>SCOPE</B> short => is not used
  1409.      *    <LI><B>COLUMN_NAME</B> String => column name
  1410.      *    <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
  1411.      *    <LI><B>TYPE_NAME</B> String => Data source dependent type name
  1412.      *    <LI><B>COLUMN_SIZE</B> int => precision
  1413.      *    <LI><B>BUFFER_LENGTH</B> int => length of column value in bytes
  1414.      *    <LI><B>DECIMAL_DIGITS</B> short     => scale
  1415.      *    <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column 
  1416.      *      like an Oracle ROWID
  1417.      *      <UL>
  1418.      *      <LI> versionColumnUnknown - may or may not be pseudo column
  1419.      *      <LI> versionColumnNotPseudo - is NOT a pseudo column
  1420.      *      <LI> versionColumnPseudo - is a pseudo column
  1421.      *      </UL>
  1422.      *  </OL>
  1423.      *
  1424.      * @param catalog a catalog name; "" retrieves those without a
  1425.      * catalog; null means drop catalog name from the selection criteria
  1426.      * @param schema a schema name; "" retrieves those without a schema
  1427.      * @param table a table name
  1428.      * @return ResultSet - each row is a column description 
  1429.      */
  1430.     ResultSet getVersionColumns(String catalog, String schema,
  1431.                 String table) throws SQLException;
  1432.     
  1433.     /**
  1434.      * VERSION COLUMNS PSEUDO_COLUMN - may or may not be pseudo column.
  1435.      */
  1436.     int versionColumnUnknown    = 0;
  1437.  
  1438.     /**
  1439.      *  VERSION COLUMNS PSEUDO_COLUMN - is NOT a pseudo column.
  1440.      */
  1441.     int versionColumnNotPseudo    = 1;
  1442.  
  1443.     /**
  1444.      *  VERSION COLUMNS PSEUDO_COLUMN - is a pseudo column.
  1445.      */
  1446.     int versionColumnPseudo    = 2;
  1447.  
  1448.     /**
  1449.      * Get a description of a table's primary key columns.  They
  1450.      * are ordered by COLUMN_NAME.
  1451.      *
  1452.      * <P>Each primary key column description has the following columns:
  1453.      *  <OL>
  1454.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1455.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1456.      *    <LI><B>TABLE_NAME</B> String => table name
  1457.      *    <LI><B>COLUMN_NAME</B> String => column name
  1458.      *    <LI><B>KEY_SEQ</B> short => sequence number within primary key
  1459.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1460.      *  </OL>
  1461.      *
  1462.      * @param catalog a catalog name; "" retrieves those without a
  1463.      * catalog; null means drop catalog name from the selection criteria
  1464.      * @param schema a schema name pattern; "" retrieves those
  1465.      * without a schema
  1466.      * @param table a table name
  1467.      * @return ResultSet - each row is a primary key column description 
  1468.      */
  1469.     ResultSet getPrimaryKeys(String catalog, String schema,
  1470.                 String table) throws SQLException;
  1471.  
  1472.     /**
  1473.      * Get a description of the primary key columns that are
  1474.      * referenced by a table's foreign key columns (the primary keys
  1475.      * imported by a table).  They are ordered by PKTABLE_CAT,
  1476.      * PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.
  1477.      *
  1478.      * <P>Each primary key column description has the following columns:
  1479.      *  <OL>
  1480.      *    <LI><B>PKTABLE_CAT</B> String => primary key table catalog 
  1481.      *      being imported (may be null)
  1482.      *    <LI><B>PKTABLE_SCHEM</B> String => primary key table schema
  1483.      *      being imported (may be null)
  1484.      *    <LI><B>PKTABLE_NAME</B> String => primary key table name
  1485.      *      being imported
  1486.      *    <LI><B>PKCOLUMN_NAME</B> String => primary key column name
  1487.      *      being imported
  1488.      *    <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
  1489.      *    <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
  1490.      *    <LI><B>FKTABLE_NAME</B> String => foreign key table name
  1491.      *    <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
  1492.      *    <LI><B>KEY_SEQ</B> short => sequence number within foreign key
  1493.      *    <LI><B>UPDATE_RULE</B> short => What happens to 
  1494.      *       foreign key when primary is updated:
  1495.      *      <UL>
  1496.      *      <LI> importedNoAction - do not allow update of primary 
  1497.      *               key if it has been imported
  1498.      *      <LI> importedKeyCascade - change imported key to agree 
  1499.      *               with primary key update
  1500.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1501.      *               its primary key has been updated
  1502.      *      <LI> importedKeySetDefault - change imported key to default values 
  1503.      *               if its primary key has been updated
  1504.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1505.      *                                 (for ODBC 2.x compatibility)
  1506.      *      </UL>
  1507.      *    <LI><B>DELETE_RULE</B> short => What happens to 
  1508.      *      the foreign key when primary is deleted.
  1509.      *      <UL>
  1510.      *      <LI> importedKeyNoAction - do not allow delete of primary 
  1511.      *               key if it has been imported
  1512.      *      <LI> importedKeyCascade - delete rows that import a deleted key
  1513.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1514.      *               its primary key has been deleted
  1515.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1516.      *                                 (for ODBC 2.x compatibility)
  1517.      *      <LI> importedKeySetDefault - change imported key to default if 
  1518.      *               its primary key has been deleted
  1519.      *      </UL>
  1520.      *    <LI><B>FK_NAME</B> String => foreign key name (may be null)
  1521.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1522.      *    <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key 
  1523.      *      constraints be deferred until commit
  1524.      *      <UL>
  1525.      *      <LI> importedKeyInitiallyDeferred - see SQL92 for definition
  1526.      *      <LI> importedKeyInitiallyImmediate - see SQL92 for definition 
  1527.      *      <LI> importedKeyNotDeferrable - see SQL92 for definition 
  1528.      *      </UL>
  1529.      *  </OL>
  1530.      *
  1531.      * @param catalog a catalog name; "" retrieves those without a
  1532.      * catalog; null means drop catalog name from the selection criteria
  1533.      * @param schema a schema name pattern; "" retrieves those
  1534.      * without a schema
  1535.      * @param table a table name
  1536.      * @return ResultSet - each row is a primary key column description 
  1537.      * @see #getExportedKeys 
  1538.      */
  1539.     ResultSet getImportedKeys(String catalog, String schema,
  1540.                 String table) throws SQLException;
  1541.  
  1542.     /**
  1543.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - for update, change
  1544.      * imported key to agree with primary key update; for delete,
  1545.      * delete rows that import a deleted key.
  1546.      */
  1547.     int importedKeyCascade    = 0;
  1548.  
  1549.     /**
  1550.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or
  1551.      * delete of primary key if it has been imported.  
  1552.      */
  1553.     int importedKeyRestrict = 1;
  1554.  
  1555.     /**
  1556.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to
  1557.      * NULL if its primary key has been updated or deleted.
  1558.      */
  1559.     int importedKeySetNull  = 2;
  1560.  
  1561.     /**
  1562.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or
  1563.      * delete of primary key if it has been imported.  
  1564.      */
  1565.     int importedKeyNoAction = 3;
  1566.  
  1567.     /**
  1568.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to
  1569.      * default values if its primary key has been updated or deleted.
  1570.      */
  1571.     int importedKeySetDefault  = 4;
  1572.  
  1573.     /**
  1574.      * IMPORT KEY DEFERRABILITY - see SQL92 for definition
  1575.      */
  1576.     int importedKeyInitiallyDeferred  = 5;
  1577.  
  1578.     /**
  1579.      * IMPORT KEY DEFERRABILITY - see SQL92 for definition
  1580.      */
  1581.     int importedKeyInitiallyImmediate  = 6;
  1582.  
  1583.     /**
  1584.      * IMPORT KEY DEFERRABILITY - see SQL92 for definition
  1585.      */
  1586.     int importedKeyNotDeferrable  = 7;
  1587.  
  1588.     /**
  1589.      * Get a description of the foreign key columns that reference a
  1590.      * table's primary key columns (the foreign keys exported by a
  1591.      * table).  They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
  1592.      * FKTABLE_NAME, and KEY_SEQ.
  1593.      *
  1594.      * <P>Each foreign key column description has the following columns:
  1595.      *  <OL>
  1596.      *    <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
  1597.      *    <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be null)
  1598.      *    <LI><B>PKTABLE_NAME</B> String => primary key table name
  1599.      *    <LI><B>PKCOLUMN_NAME</B> String => primary key column name
  1600.      *    <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
  1601.      *      being exported (may be null)
  1602.      *    <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
  1603.      *      being exported (may be null)
  1604.      *    <LI><B>FKTABLE_NAME</B> String => foreign key table name
  1605.      *      being exported
  1606.      *    <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
  1607.      *      being exported
  1608.      *    <LI><B>KEY_SEQ</B> short => sequence number within foreign key
  1609.      *    <LI><B>UPDATE_RULE</B> short => What happens to 
  1610.      *       foreign key when primary is updated:
  1611.      *      <UL>
  1612.      *      <LI> importedNoAction - do not allow update of primary 
  1613.      *               key if it has been imported
  1614.      *      <LI> importedKeyCascade - change imported key to agree 
  1615.      *               with primary key update
  1616.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1617.      *               its primary key has been updated
  1618.      *      <LI> importedKeySetDefault - change imported key to default values 
  1619.      *               if its primary key has been updated
  1620.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1621.      *                                 (for ODBC 2.x compatibility)
  1622.      *      </UL>
  1623.      *    <LI><B>DELETE_RULE</B> short => What happens to 
  1624.      *      the foreign key when primary is deleted.
  1625.      *      <UL>
  1626.      *      <LI> importedKeyNoAction - do not allow delete of primary 
  1627.      *               key if it has been imported
  1628.      *      <LI> importedKeyCascade - delete rows that import a deleted key
  1629.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1630.      *               its primary key has been deleted
  1631.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1632.      *                                 (for ODBC 2.x compatibility)
  1633.      *      <LI> importedKeySetDefault - change imported key to default if 
  1634.      *               its primary key has been deleted
  1635.      *      </UL>
  1636.      *    <LI><B>FK_NAME</B> String => foreign key name (may be null)
  1637.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1638.      *    <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key 
  1639.      *      constraints be deferred until commit
  1640.      *      <UL>
  1641.      *      <LI> importedKeyInitiallyDeferred - see SQL92 for definition
  1642.      *      <LI> importedKeyInitiallyImmediate - see SQL92 for definition 
  1643.      *      <LI> importedKeyNotDeferrable - see SQL92 for definition 
  1644.      *      </UL>
  1645.      *  </OL>
  1646.      *
  1647.      * @param catalog a catalog name; "" retrieves those without a
  1648.      * catalog; null means drop catalog name from the selection criteria
  1649.      * @param schema a schema name pattern; "" retrieves those
  1650.      * without a schema
  1651.      * @param table a table name
  1652.      * @return ResultSet - each row is a foreign key column description 
  1653.      * @see #getImportedKeys 
  1654.      */
  1655.     ResultSet getExportedKeys(String catalog, String schema,
  1656.                 String table) throws SQLException;
  1657.  
  1658.     /**
  1659.      * Get a description of the foreign key columns in the foreign key
  1660.      * table that reference the primary key columns of the primary key
  1661.      * table (describe how one table imports another's key.) This
  1662.      * should normally return a single foreign key/primary key pair
  1663.      * (most tables only import a foreign key from a table once.)  They
  1664.      * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
  1665.      * KEY_SEQ.
  1666.      *
  1667.      * <P>Each foreign key column description has the following columns:
  1668.      *  <OL>
  1669.      *    <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
  1670.      *    <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be null)
  1671.      *    <LI><B>PKTABLE_NAME</B> String => primary key table name
  1672.      *    <LI><B>PKCOLUMN_NAME</B> String => primary key column name
  1673.      *    <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
  1674.      *      being exported (may be null)
  1675.      *    <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
  1676.      *      being exported (may be null)
  1677.      *    <LI><B>FKTABLE_NAME</B> String => foreign key table name
  1678.      *      being exported
  1679.      *    <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
  1680.      *      being exported
  1681.      *    <LI><B>KEY_SEQ</B> short => sequence number within foreign key
  1682.      *    <LI><B>UPDATE_RULE</B> short => What happens to 
  1683.      *       foreign key when primary is updated:
  1684.      *      <UL>
  1685.      *      <LI> importedNoAction - do not allow update of primary 
  1686.      *               key if it has been imported
  1687.      *      <LI> importedKeyCascade - change imported key to agree 
  1688.      *               with primary key update
  1689.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1690.      *               its primary key has been updated
  1691.      *      <LI> importedKeySetDefault - change imported key to default values 
  1692.      *               if its primary key has been updated
  1693.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1694.      *                                 (for ODBC 2.x compatibility)
  1695.      *      </UL>
  1696.      *    <LI><B>DELETE_RULE</B> short => What happens to 
  1697.      *      the foreign key when primary is deleted.
  1698.      *      <UL>
  1699.      *      <LI> importedKeyNoAction - do not allow delete of primary 
  1700.      *               key if it has been imported
  1701.      *      <LI> importedKeyCascade - delete rows that import a deleted key
  1702.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1703.      *               its primary key has been deleted
  1704.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1705.      *                                 (for ODBC 2.x compatibility)
  1706.      *      <LI> importedKeySetDefault - change imported key to default if 
  1707.      *               its primary key has been deleted
  1708.      *      </UL>
  1709.      *    <LI><B>FK_NAME</B> String => foreign key name (may be null)
  1710.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1711.      *    <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key 
  1712.      *      constraints be deferred until commit
  1713.      *      <UL>
  1714.      *      <LI> importedKeyInitiallyDeferred - see SQL92 for definition
  1715.      *      <LI> importedKeyInitiallyImmediate - see SQL92 for definition 
  1716.      *      <LI> importedKeyNotDeferrable - see SQL92 for definition 
  1717.      *      </UL>
  1718.      *  </OL>
  1719.      *
  1720.      * @param primaryCatalog a catalog name; "" retrieves those without a
  1721.      * catalog; null means drop catalog name from the selection criteria
  1722.      * @param primarySchema a schema name pattern; "" retrieves those
  1723.      * without a schema
  1724.      * @param primaryTable the table name that exports the key
  1725.      * @param foreignCatalog a catalog name; "" retrieves those without a
  1726.      * catalog; null means drop catalog name from the selection criteria
  1727.      * @param foreignSchema a schema name pattern; "" retrieves those
  1728.      * without a schema
  1729.      * @param foreignTable the table name that imports the key
  1730.      * @return ResultSet - each row is a foreign key column description 
  1731.      * @see #getImportedKeys 
  1732.      */
  1733.     ResultSet getCrossReference(
  1734.         String primaryCatalog, String primarySchema, String primaryTable,
  1735.         String foreignCatalog, String foreignSchema, String foreignTable
  1736.         ) throws SQLException;
  1737.  
  1738.     /**
  1739.      * Get a description of all the standard SQL types supported by
  1740.      * this database. They are ordered by DATA_TYPE and then by how
  1741.      * closely the data type maps to the corresponding JDBC SQL type.
  1742.      *
  1743.      * <P>Each type description has the following columns:
  1744.      *  <OL>
  1745.      *    <LI><B>TYPE_NAME</B> String => Type name
  1746.      *    <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
  1747.      *    <LI><B>PRECISION</B> int => maximum precision
  1748.      *    <LI><B>LITERAL_PREFIX</B> String => prefix used to quote a literal 
  1749.      *      (may be null)
  1750.      *    <LI><B>LITERAL_SUFFIX</B> String => suffix used to quote a literal 
  1751.             (may be null)
  1752.      *    <LI><B>CREATE_PARAMS</B> String => parameters used in creating 
  1753.      *      the type (may be null)
  1754.      *    <LI><B>NULLABLE</B> short => can you use NULL for this type?
  1755.      *      <UL>
  1756.      *      <LI> typeNoNulls - does not allow NULL values
  1757.      *      <LI> typeNullable - allows NULL values
  1758.      *      <LI> typeNullableUnknown - nullability unknown
  1759.      *      </UL>
  1760.      *    <LI><B>CASE_SENSITIVE</B> boolean=> is it case sensitive?
  1761.      *    <LI><B>SEARCHABLE</B> short => can you use "WHERE" based on this type:
  1762.      *      <UL>
  1763.      *      <LI> typePredNone - No support
  1764.      *      <LI> typePredChar - Only supported with WHERE .. LIKE
  1765.      *      <LI> typePredBasic - Supported except for WHERE .. LIKE
  1766.      *      <LI> typeSearchable - Supported for all WHERE ..
  1767.      *      </UL>
  1768.      *    <LI><B>UNSIGNED_ATTRIBUTE</B> boolean => is it unsigned?
  1769.      *    <LI><B>FIXED_PREC_SCALE</B> boolean => can it be a money value?
  1770.      *    <LI><B>AUTO_INCREMENT</B> boolean => can it be used for an 
  1771.      *      auto-increment value?
  1772.      *    <LI><B>LOCAL_TYPE_NAME</B> String => localized version of type name 
  1773.      *      (may be null)
  1774.      *    <LI><B>MINIMUM_SCALE</B> short => minimum scale supported
  1775.      *    <LI><B>MAXIMUM_SCALE</B> short => maximum scale supported
  1776.      *    <LI><B>SQL_DATA_TYPE</B> int => unused
  1777.      *    <LI><B>SQL_DATETIME_SUB</B> int => unused
  1778.      *    <LI><B>NUM_PREC_RADIX</B> int => usually 2 or 10
  1779.      *  </OL>
  1780.      *
  1781.      * @return ResultSet - each row is a SQL type description 
  1782.      */
  1783.     ResultSet getTypeInfo() throws SQLException;
  1784.     
  1785.     /**
  1786.      * TYPE NULLABLE - does not allow NULL values.
  1787.      */
  1788.     int typeNoNulls = 0;
  1789.  
  1790.     /**
  1791.      * TYPE NULLABLE - allows NULL values.
  1792.      */
  1793.     int typeNullable = 1;
  1794.  
  1795.     /**
  1796.      * TYPE NULLABLE - nullability unknown.
  1797.      */
  1798.     int typeNullableUnknown = 2;
  1799.  
  1800.     /**
  1801.      * TYPE INFO SEARCHABLE - No support.
  1802.      */
  1803.     int typePredNone = 0;
  1804.  
  1805.     /**
  1806.      * TYPE INFO SEARCHABLE - Only supported with WHERE .. LIKE.
  1807.      */
  1808.     int typePredChar = 1;
  1809.  
  1810.     /**
  1811.      * TYPE INFO SEARCHABLE -  Supported except for WHERE .. LIKE.
  1812.      */
  1813.     int typePredBasic = 2;
  1814.  
  1815.     /**
  1816.      * TYPE INFO SEARCHABLE - Supported for all WHERE ...
  1817.      */
  1818.     int typeSearchable  = 3;
  1819.  
  1820.     /**
  1821.      * Get a description of a table's indices and statistics. They are
  1822.      * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
  1823.      *
  1824.      * <P>Each index column description has the following columns:
  1825.      *  <OL>
  1826.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1827.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1828.      *    <LI><B>TABLE_NAME</B> String => table name
  1829.      *    <LI><B>NON_UNIQUE</B> boolean => Can index values be non-unique? 
  1830.      *      false when TYPE is tableIndexStatistic
  1831.      *    <LI><B>INDEX_QUALIFIER</B> String => index catalog (may be null); 
  1832.      *      null when TYPE is tableIndexStatistic
  1833.      *    <LI><B>INDEX_NAME</B> String => index name; null when TYPE is 
  1834.      *      tableIndexStatistic
  1835.      *    <LI><B>TYPE</B> short => index type:
  1836.      *      <UL>
  1837.      *      <LI> tableIndexStatistic - this identifies table statistics that are
  1838.      *           returned in conjuction with a table's index descriptions
  1839.      *      <LI> tableIndexClustered - this is a clustered index
  1840.      *      <LI> tableIndexHashed - this is a hashed index
  1841.      *      <LI> tableIndexOther - this is some other style of index
  1842.      *      </UL>
  1843.      *    <LI><B>ORDINAL_POSITION</B> short => column sequence number 
  1844.      *      within index; zero when TYPE is tableIndexStatistic
  1845.      *    <LI><B>COLUMN_NAME</B> String => column name; null when TYPE is 
  1846.      *      tableIndexStatistic
  1847.      *    <LI><B>ASC_OR_DESC</B> String => column sort sequence, "A" => ascending, 
  1848.      *      "D" => descending, may be null if sort sequence is not supported; 
  1849.      *      null when TYPE is tableIndexStatistic    
  1850.      *    <LI><B>CARDINALITY</B> int => When TYPE is tableIndexStatistic, then 
  1851.      *      this is the number of rows in the table; otherwise, it is the 
  1852.      *      number of unique values in the index.
  1853.      *    <LI><B>PAGES</B> int => When TYPE is  tableIndexStatisic then 
  1854.      *      this is the number of pages used for the table, otherwise it 
  1855.      *      is the number of pages used for the current index.
  1856.      *    <LI><B>FILTER_CONDITION</B> String => Filter condition, if any.  
  1857.      *      (may be null)
  1858.      *  </OL>
  1859.      *
  1860.      * @param catalog a catalog name; "" retrieves those without a
  1861.      * catalog; null means drop catalog name from the selection criteria
  1862.      * @param schema a schema name pattern; "" retrieves those without a schema
  1863.      * @param table a table name  
  1864.      * @param unique when true, return only indices for unique values; 
  1865.      *     when false, return indices regardless of whether unique or not 
  1866.      * @param approximate when true, result is allowed to reflect approximate 
  1867.      *     or out of data values; when false, results are requested to be 
  1868.      *     accurate
  1869.      * @return ResultSet - each row is an index column description 
  1870.      */
  1871.     ResultSet getIndexInfo(String catalog, String schema, String table,
  1872.             boolean unique, boolean approximate)
  1873.                     throws SQLException;
  1874.  
  1875.     /**
  1876.      * INDEX INFO TYPE - this identifies table statistics that are
  1877.      * returned in conjuction with a table's index descriptions
  1878.      */
  1879.     short tableIndexStatistic = 0;
  1880.  
  1881.     /**
  1882.      * INDEX INFO TYPE - this identifies a clustered index
  1883.      */
  1884.     short tableIndexClustered = 1;
  1885.  
  1886.     /**
  1887.      * INDEX INFO TYPE - this identifies a hashed index
  1888.      */
  1889.     short tableIndexHashed    = 2;
  1890.  
  1891.     /**
  1892.      * INDEX INFO TYPE - this identifies some other form of index
  1893.      */
  1894.     short tableIndexOther     = 3;
  1895.  }
  1896.  
  1897.